package com.jh.mms.service.impl;

import java.util.ArrayList;

import com.jh.mms.dao.IHqlDao;
import com.jh.mms.dao.ISqlDao;
import com.jh.mms.service.ILogin;

public class LoginImpl implements ILogin {
	
	private IHqlDao hqlDao;
	private ISqlDao sqlDao;
	
	public void setHqlDao(IHqlDao hqlDao) {
		this.hqlDao = hqlDao;
	}

	public void setSqlDao(ISqlDao sqlDao) {
		this.sqlDao = sqlDao;
	}


	public boolean login(String name, String pwd) {
		String hql="from Tuserinfo u where u.tel = ? and u.pwd = ?";
		ArrayList<String> params = new ArrayList<String>();
		params.add(name);
		params.add(pwd);
		return hqlDao.listCount(hql, params) > 0;
	}

}
